
import request from '@/utils/request'
/***
 * 获取用户所有订单
 * @param data 用户id
 */
export function getOrders(data) {
    return request({
        url: `/api/order/all/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

/***
 * 删除订单
 * @param data 订单id
 */
export function deleteMyOrder(data) {
    return request({
        url: `/api/order/delete/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

/***
 * 获取订单所有信息
 * @param data 订单id
 */
export function getOrderDetail(data) {
    return request({
        url: `/api/orderdetail/all/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

export function getAll(data) {
    return request({
        url: `/api/order/all/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

export function deleteOrder(data) {
    return request({
        url: `/api/order/delete/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

//待付款
export function getWaitPay(data) {
    return request({
        url: `/api/order/waitpay/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

//待送达
export function getWaitArrive(data) {
    return request({
        url: `/api/order/waitarrive/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

//待评论
export function getWaitRemark(data) {
    return request({
        url: `/api/order/waitremark/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

//待完成
export function getWaitComplete(data) {
    return request({
        url: `/api/order/unaccomplished/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

//待退款
export function getRefund(data) {
    return request({
        url: `/api/order/refund/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

export function getAfterPay(data) {
    return request({
        url: `/api/order/afterpay/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}
//改变订单状态
export function changeStatus(data) {
    return request({
        url: `/api/order/changeStatus`,
        //post请求
        method: 'post',
        data
    })
}

//人均消费
export function getPersonAmount(data) {
    return request({
        url: `/api/collectShop/getamount/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

//月销售量
export function getMonthlyNum(data) {
    return request({
        url: `/api/collectShop/getnum/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}

//订单信息
export function queryOrderById(data) {
    return request({
        url: `/api/order/query/${data.id}`,
        //post请求
        method: 'post',
        data
    })
}
